<template>
  <div>
    <p>
      <h-switch v-model="border" small>显示边框</h-switch>
      <h-switch v-model="stripe" small>栅格背景</h-switch>
    </p>
    <p>
      <!-- <h-switch v-model="checkbox" small>多选</h-switch> -->
      <h-switch v-model="serial" small>显示序号</h-switch>
      <!-- <h-switch v-model="show" small>切换显示</h-switch> -->
    </p>
    <!-- <p><h-switch v-model="loading" small>loading</h-switch></p>
    <p>
      <Button color="blue" icon="h-icon-plus" @click="add(datas)"
        >添加一行</Button
      >
      <Button color="primary" @click="datas = []">清空数据</Button>
    </p> -->
    <Table
      :datas="datas"
      :border="border"
      :checkbox="checkbox"
      :stripe="stripe"
      :loading="loading"
    >
      <TableItem title="序号" prop="$serial" v-if="serial"></TableItem>
      <TableItem title="岗位" prop="job_name"></TableItem>
      <TableItem title="公司名称" prop="company_name"></TableItem>
      <!-- <TableItem align="center" title="Age" prop="age" sort="auto"></TableItem> -->
      <TableItem title="薪资" prop="salary"></TableItem>
      <TableItem title="工作经验" prop="experience"></TableItem>
      <TableItem title="地区" prop="work_area"></TableItem>
      <TableItem title="学历" prop="educational_background"></TableItem>
      <TableItem title="公司规模" prop="company_size"></TableItem>
      <TableItem title="公司类型" prop="company_type"></TableItem>
      <TableItem
        v-if="show"
        title="Address-切换显示"
        align="right"
        prop="address"
      ></TableItem>
      <div slot="empty">自定义提醒：暂时无数据</div>
    </Table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      border: false,
      stripe: false,
      checkbox: false,
      serial: false,
      loading: false,
      datas: [],
    };
  },
  mounted() {
    this.design_list()
  },
  methods: {
    design_list(){
            this.axios.get('/api/design/info').then((res)=>{
            // 判断返回信息状态
            if(res.data.code==200){
                this.datas = res.data.list
            }
        }) 
        },
    add(datas) {
      datas.push({ id: 7, name: "添加", age: 12, address: "然后添加的" });
    }
  }
};
</script>
